﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BusinessBingo.Web.Helpers
{
    public static class HtmlHelperExtensions
    {
        public static HtmlString ScriptInclude(this HtmlHelper html, string jsFile)
        {
            string jsPath = string.Format("~/Scripts/{0}", jsFile);
            UrlHelper helper = new UrlHelper(html.ViewContext.RequestContext);
            string url = helper.Content(jsPath);

            string returnString = string.Format("<script type=\"text/javascript\" src=\"{0}\" ></script>\n", url);

            return new HtmlString(returnString);
        }
    }
}